syms x y;
w1 = collect((exp(x)+x)*(x+2))
w2 = collect((x+y)*(x^2+y^2+1), y)
w3 = collect([(x+1)*(y+1),x+y])
